/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpaintball;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author ondra
 */
public class StartServerDialog extends Dialog {

    JTextField port;
    JButton    startButton;

    StartServerDialog(GameWindow _owner) {

        super("Start game server",_owner);
        
        // add components
        port = new JTextField("2222");
        startButton = new JButton("Start!");
        startButton.addActionListener(new StartButtonAction());
        add(new JLabel("TCP Port:"));
        add(port);
        add(startButton);

        showDialog();
    }

    private class StartButtonAction implements ActionListener {

        public void actionPerformed(ActionEvent arg0) {
            owner.startGame();
            closeDialog();
        }

    }

}
